package com.seed.core.pojo.dto;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * @author gchiaway
 * 日期: 2020-10-13
 * 时间: 10:06
 */
@Getter
@Setter
@ToString
public class SeedDataDTO<T> extends SeedMessageDTO {
    /**
     * 数据
     */
    private T data;

    public SeedDataDTO<T> success(T data) {
        super.success();
        this.data = data;
        return this;
    }

    public SeedDataDTO<T> success(String msg, T data) {
        super.success(msg);
        this.data = data;
        return this;
    }

    public SeedDataDTO<T> success(String msg, String code, T data) {
        super.success(msg, code);
        this.data = data;
        return this;
    }

    public SeedDataDTO<T> error(T data) {
        super.error();
        this.data = data;
        return this;
    }

    public SeedDataDTO<T> error(String msg, T data) {
        super.error(msg);
        this.data = data;
        return this;
    }

    public SeedDataDTO<T> error(String msg, String code, T data) {
        super.error(msg, code);
        this.data = data;
        return this;
    }

}
